package com.junxonline.instant.dao.entity.model.log;

import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson.serializer.ToStringSerializer;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 系统操作日志表实体类
 *
 * @author JunX
 * @date 2021-07-16
 */
@Data
@TableName(value = "sys_log_operation")
public class LogOperation implements Serializable {

    /**
     * ID
     */
    @TableId(type = IdType.AUTO)
    @JSONField(serializeUsing = ToStringSerializer.class)
    private Long id;

    /**
     * 操作名称
     */
    @TableField(value = "name")
    private String name;

    /**
     * 操作类型
     */
    @TableField(value = "type")
    @JSONField(serializeUsing = ToStringSerializer.class)
    private Integer type;

    /**
     * 操作URL
     */
    @TableField(value = "url")
    private String url;

    /**
     * 操作者
     */
    @TableField(value = "create_id")
    @JSONField(serializeUsing = ToStringSerializer.class)
    private Long createId;

    /**
     * 操作者IP
     */
    @TableField(value = "user_ip")
    private String userIp;

    /**
     * 目标系统IP
     */
    @TableField(value = "target_ip")
    private String targetIp;

    /**
     * 浏览器
     */
    @TableField(value = "browser")
    private String browser;

    /**
     * 操作系统
     */
    @TableField(value = "os")
    private String os;

    /**
     * 操作结果
     */
    @TableField(value = "status")
    @JSONField(serializeUsing = ToStringSerializer.class)
    private Integer status;

    /**
     * 操作参数
     */
    @TableField(value = "params")
    private String params;

    /**
     * 操作时间
     */
    @TableField(value = "operation_time")
    private Date operationTime;

    /**
     * 操作者
     */
    @TableField(exist = false)
    private String createName;

}
